local thbattle__zhengxie_nizhuan = fk.CreateSkill {

  name = "thbattle__zhengxie_nizhuan",

  tags = {},

}



thbattle__zhengxie_nizhuan:addEffect(fk.TargetConfirming, {
  prompt = "#thbattle__zhengxie_nizhuan",
  anim_type = "masochism",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(thbattle__zhengxie_nizhuan.name) and data.card and data.from ~= player and
        data.card.trueName == "slash"
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local useplayer = data.from
    player:drawCards(1, thbattle__zhengxie_nizhuan.name)
    if #player:getCardIds("h") > #useplayer:getCardIds("h") then
      data:cancelTarget(player)
      data.nullified = true
      room:useCard({
        from = useplayer,
        tos = { player },
        card = Fk:cloneCard("danmuzhan__duel"),
      })
    end
  end
})

return thbattle__zhengxie_nizhuan
